#pragma once
#include <vector>
#include "Camera.h"

#define MAXCAMERAS 20

// allows a collection of named cameras, so user can switch between different camera
// angles and types (stationary, following etc)
class CameraManager
{

public:
	CameraManager(void)
	{
		// init array
		for(unsigned int i=0; i< MAXCAMERAS; i++)
			Cameras[i] = 0;
	}

	virtual ~CameraManager(void)
	{
		// delete active cameras in array
		for(unsigned int i=0; i< MAXCAMERAS; i++)
			if(Cameras[i] != 0)
				delete Cameras[i];
	}

	// get current view matrix
	D3DXMATRIXA16 GetViewMatrix()
	{
		return CurrentCamera->GetViewMatrix();
	}

	// add new camera
	void AddCamera(unsigned int index, Camera* newCamera)
	{
		Cameras[index] = newCamera;
	}

	// set current camera
	void SetCurrentCamera(unsigned int index)
	{
		if(Cameras[index] != 0)
			CurrentCamera = Cameras[index];
	}




protected:
	Camera* Cameras [MAXCAMERAS]; // maximum 20 cameras
	Camera* CurrentCamera;
};
